<template>
  <div>
      <h4>第三题</h4>
      年龄和为：{{ sum }}
  </div>
</template>

<script>
export default {
  data () {
    return {
      arr: [{
        name: '小明',
        age: 18
      }, {
        name: '小花',
        age: 25
      }, {
        name: '小爱',
        age: 21
      }],
      sum: ''
    }
  },
  created () {
    this.sum = this.arr.reduce((accu, obj) => accu + obj.age, 0)
  }
}
</script>

<style>

</style>
